#include<iostream>
using namespace std;
int main()
{
	int a[10] = { 0 };
	int b;
	int count = 0;
	for (int i = 0; i < 10; ++i)
	{
		cin >> a[i];
	}
	cin >> b;
	for (int j = 0; j < 10; ++j)
	{
		if (b + 30 >= a[j])
			count++;
	}
	cout << count;
}